﻿// 1.1.6.02. Write a program that prints all the numbers from 1 to N, that are not divisible by 3 and 7 at the same time.

using System;

class PrintingNumsNotDivisibleBy5n7
{
    static void Main()
    {
        int userInput = int.Parse(Console.ReadLine());
        for (int i = 1; i < userInput; i++)
        {
            if (i % 3 != 0 && i % 7 != 0)
            {
                Console.WriteLine(i);
            }
        }
    }
}